package ThreadOperation;

public class ThreadYield
{
    public static void main(String[] args)
    {
        MyYield my =new MyYield();
        new Thread(my,"aThread").start();
        new Thread(my,"bThread").start();
    }
}

class MyYield implements Runnable
{
    @Override
    public void run()
    {
        System.out.println(Thread.currentThread().getName()+"Start!");
        Thread.yield();
        System.out.println(Thread.currentThread().getName()+"End!");
    }
}
